﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

#nullable disable

namespace T4.Console.Db.Models
{
    [Table("Sys_Module")]
    public partial class Sys_Module
    {
        public Sys_Module()
        {
            Sys_ModuleButtons = new HashSet<Sys_ModuleButton>();
            Sys_RoleModuleButtons = new HashSet<Sys_RoleModuleButton>();
            Sys_RoleModules = new HashSet<Sys_RoleModule>();
        }

        [Key]
        [StringLength(36)]
        public string Id { get; set; }
        [Required]
        [StringLength(50)]
        public string ApplicationCode { get; set; }
        [Required]
        [StringLength(100)]
        public string Name { get; set; }
        public int Level { get; set; }
        [StringLength(36)]
        public string ParentId { get; set; }
        [StringLength(255)]
        public string Url { get; set; }
        public bool? IsShowUI { get; set; }
        [StringLength(100)]
        public string IconName { get; set; }
        public int Sort { get; set; }
        public bool IsActive { get; set; }
        [StringLength(100)]
        public string ApiController { get; set; }
        [StringLength(36)]
        public string CreatedBy { get; set; }
        [Column(TypeName = "datetime")]
        public DateTime? CreatedTime { get; set; }
        [StringLength(36)]
        public string LastModifiedBy { get; set; }
        [Column(TypeName = "datetime")]
        public DateTime? LastModifiedTime { get; set; }

        [InverseProperty(nameof(Sys_ModuleButton.Module))]
        public virtual ICollection<Sys_ModuleButton> Sys_ModuleButtons { get; set; }
        [InverseProperty(nameof(Sys_RoleModuleButton.Module))]
        public virtual ICollection<Sys_RoleModuleButton> Sys_RoleModuleButtons { get; set; }
        [InverseProperty(nameof(Sys_RoleModule.Module))]
        public virtual ICollection<Sys_RoleModule> Sys_RoleModules { get; set; }
    }
}
